var util = require('we7/resource/js/util.js');
var customUtil = require('customUtil/customUtil.js');
App({
    onLaunch: function (res) {
      //加载七牛云
      customUtil.httpPost('/index/QiNiu/getQiNiuDomain')
        .then((datas) => {
          var data = datas.data;
          this.appInfo.qiniuInfo.domain = data.qiniuDomain;
        }, (err) => {

        })
      this.appInfo.qiniuInfo.uptokenURL = this.siteInfo.siteroot + this.appInfo.qiniuInfo.uptokenURL;
    },
    onShow: function (res) {
    },
    onHide: function () {
    },
    onError: function (msg) {
        console.log(msg)
    },
    appInfo: {
      qiniuInfo: {
        domain: 'pn8ahu69w.bkt.clouddn.com',
        uptokenURL:  '/fastAsk/public/index.php/index/QiNiu/getQiNiuToken'
      },
      hoursClose: 72,
      subject: {
        color: '#F95E4A',
        btnColor: '#2faff6'
      }
    },
    //加载自定义工具函数
    customUtil: customUtil,
    //加载微擎工具类
    util: util,
    //导航菜单，微擎将会自己实现一个导航菜单，结构与小程序导航菜单相同
    //用户信息，sessionid是用户是否登录的凭证
    userInfo: {
        userToken: null,
        sessionid: null,
        avatarUrl: '',
        nickName: ''
    },
    
    siteInfo: require('siteinfo.js')
});